import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import {initMenu} from "./utils/menus";
// import {deleteRequest, getRequest, postRequest, putRequest} from "./utils/api";


const app = createApp(App);
app.use(router).use(store).use(ElementPlus).mount('#app');

router.beforeEach((to, from, next) => {
    if (window.sessionStorage.getItem("tokenStr")) {
        initMenu(router, store);
        next();
    } else {
        next();
    }
})

// 统一导入 请求
// app.prototype.postRequest = postRequest;
// app.prototype.putRequest = putRequest;
// app.prototype.getRequest = getRequest;
// app.prototype.deleteRequest = deleteRequest;
